package io.openkunlun.javarpc.codegen;

public class RpcParameter {

    private final String name;
    private final String type;
    private final String castType;

    private RpcParameter(Builder builder) {
        this.name = builder.name;
        this.type = builder.type;
        this.castType = builder.castType;
    }

    public String getName() {
        return name;
    }

    public String getType() {
        return type;
    }

    public String getCastType() {
        return castType;
    }

    static Builder newBuilder() {
        return new Builder();
    }

    static final class Builder {
        private String name;
        private String type;
        private String castType;

        private Builder() {
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder type(String type) {
            this.type = type;
            return this;
        }

        public Builder castType(String castType) {
            this.castType = castType;
            return this;
        }

        public RpcParameter build() {
            return new RpcParameter(this);
        }
    }
}
